import React from "react";
import ReactDOM from "react-dom/client";
import "@/assets/style/frame.scss";
import router from "@/router";
import { RouterProvider } from "react-router-dom";
import { ConfigProvider } from "antd";
import { wihteTheme } from "./config/antdTheme";
import { Provider } from "react-redux";
import store from "@/store/store";
import zhCN from "antd/locale/zh_CN";
import "@/assets/icon/iconfont.css";

const rootElement = document.getElementById("root");
if (!rootElement) {
  throw new Error("Failed to find the root element");
}
const root = ReactDOM.createRoot(rootElement);
if (!root) {
  throw new Error("Failed to find the root element");
}

root.render(
  <Provider store={store}>
    <ConfigProvider theme={wihteTheme} locale={zhCN}>
      <RouterProvider router={router}></RouterProvider>
    </ConfigProvider>
  </Provider>
);
